﻿using System;

namespace FluentSql
{
    public class DalContext : IDalContext
    {
        #region Public Constructors

        public DalContext(IDalSqlConnection iPersistentConnection)
        {
            PersistentConnection = iPersistentConnection;
        }

        public DalContext(IDalSqlConnectionFactory iConnectionFactory)
        {
            ConnectionFactory = iConnectionFactory;
        }

        #endregion Public Constructors

        #region Public Properties

        public IDalSqlConnection PersistentConnection { get; private set; }

        public IDalSqlConnectionFactory ConnectionFactory { get; private set; }

        public IDalSqlConnection CreateConnection()
        {
            return ConnectionFactory.CreateConnection();
        }

        #endregion Public Properties
    }
}
